﻿using University;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace UniversityTest
{
    [TestClass]
    public class SchoolTest
    {
        [TestMethod]
        public void AddCourseTest()
        {
            School school = new School();
            Course course = new Course("course");
            school.AddCourse(course);
            Assert.AreEqual(course, school.Courses[0]);
        }

        [TestMethod]
        public void AddStudentTest()
        {
            School school = new School();
            Student student = new Student("student", 12345);
            school.AddStudent(student);
            Assert.AreEqual(student, school.Students[0]);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentException), "FN should be unique!")]
        public void AddTwoStudentsWithSameFNTest()
        {
            School school = new School();
            Student student = new Student("student", 12345);
            school.AddStudent(student);
            school.AddStudent(student);
        }
    }
}
